-
Notifications
You must be signed in to change notification settings - Fork 584
Add Conformance tests for BackendTLSPolicy validating SANs with Type dsnName #3983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hi @kl52752. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kl52752!
|
||
// Verify that request sent to Service targeted by BackendTLSPolicy with mismatched SAN should failed. | ||
t.Run("HTTP request send to Service targeted by BackendTLSPolicy with mismatched SAN should return HTTP error", func(t *testing.T) { | ||
h.MakeRequestAndExpectFailure(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this will pass if any non-200 error code is returned. Can we be more specific here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the spec is a bit vague here, error codes are not constrained but it is up to implementation how to signal the error
subjectAltNames: | ||
- type: Hostname | ||
hostname: abc.example.com | ||
hostname: "mismatch.example.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it's testing a config mismatch instead of a mismatch in the cert itself. Can we also include a test that covers a case where the config lines up but the cert served by the backend does not match either the configured hostname or the SANs?
b4f63d3
to
34f8d3b
Compare
/assign @robscott |
@@ -389,6 +389,11 @@ func (suite *ConformanceTestSuite) Setup(t *testing.T, tests []ConformanceTest) | |||
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{caConfigMap}, suite.Cleanup) | |||
secret = kubernetes.MustCreateCASignedCertSecret(t, "gateway-conformance-infra", "tls-checks-certificate", []string{"abc.example.com"}, ca, caPrivKey) | |||
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{secret}, suite.Cleanup) | |||
// TODO(kl52752) Merge CA certificates for Backend TLS Policy and move Deployment to common file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kl52752, robscott, snorwin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
envoy gateway fails to work, checking here if it is related to the gateway itself or something with tests
|
@snorwin @kl52752 from my tests it seems that the expected behavior of envoy-gateway failing to send the request to a backend because the certs don't match is not being respected by envoy gateway. edit: just clarifying, this seems to me a lack of conformance on envoy gateway, the test seems fine. Did we tested with Istio as well? /cc @candita |
Tried to test with Istio as well, and miserably failed (probably my own fault) Installed with |
I also tried testing it with kgateway, but without success. It seems that most implementations are not yet fully conformant with the BackendTLSPolicy specification, since we only recently began developing conformance tests. |
/lgtm Please wait for Candace's unhold :) |
/assign @shaneutt |
What type of PR is this?
/kind test
What this PR does / why we need it:
Add Conformance tests for BackendTLSPolicy validating SANs set with Type dns name
Which issue(s) this PR fixes:
Relates to #3979
Does this PR introduce a user-facing change?: